<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */
?>
<div class="admin-model-index">

    <p>
        <?php if (\backend\components\MenuHelper::checkRoute('create-role')){ echo Html::a('添加角色', ['create-role'], ['class' => 'btn btn-success']) ;  } ?>
    </p>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
            'id',
            'name',
            'des',
            [
                'class' => 'yii\grid\ActionColumn',
                'template' => \backend\components\MenuHelper::filterActionColumn('{update}&nbsp;&nbsp;{delete}'),
                'buttons' => [
                        'delete'=>function($url,$model){
                            
                            return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => '删除','data' => [
                                'confirm' => "您确定要删除此项吗？",
                                'method' => 'post',
                            ]]);
                        }
                ]
            ]
        ],
    ]); ?>
</div>
